import React, { useState, useEffect, useRef } from 'react';
import { Card, Button } from 'antd';
import { Link, request } from 'umi';
import ReportCard from './components/ReportCard';


const Report = () => {
 const refList = useRef([])
 const [data,SetDate] = useState(['1','2','3']) 
 
 const getRef = (dom) => {
   refList.current.push(dom)
 }

 useEffect(() => {
  init()
 },[])

 const init = () => {
   let listHtml = refList.current
   console.log(listHtml)
 }

  return (
    <div>
      <Card>
      <div id="wrappent">
      {
        data.map((item,index)=>(
          <div key={index} ref={getRef} id={'my-list-item' + index}>
            {item}
       	  </div>
       	))
      }
    </div>
        <Button type={'primary'} size={'middle'}>
          <Link to={'/report/write'}>写日报</Link>
        </Button>
        <ReportCard />
      </Card>
    </div>
  );
};

export default Report;
